<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: gdsl_bstree.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('gdsl__bstree_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">gdsl_bstree.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gdsl__bstree_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * This file is part of the Generic Data Structures Library (GDSL).</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2006 Nicolas Darnis &lt;ndarnis@free.fr&gt;.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * The GDSL library is free software; you can redistribute it and/or </span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public License as </span>
<a name="l00007"></a>00007 <span class="comment"> * published by the Free Software Foundation; either version 2 of</span>
<a name="l00008"></a>00008 <span class="comment"> * the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * The GDSL library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with the GDSL library; see the file COPYING.</span>
<a name="l00017"></a>00017 <span class="comment"> * If not, write to the Free Software Foundation, Inc., </span>
<a name="l00018"></a>00018 <span class="comment"> * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * $RCSfile: gdsl__bstree_8h_source.html,v $</span>
<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.3 $</span>
<a name="l00022"></a>00022 <span class="comment"> * $Date: 2013/06/12 16:36:13 $</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef _GDSL_BSTREE_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _GDSL_BSTREE_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="gdsl__types_8h.html">gdsl_types.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> 
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00053"></a><a class="code" href="group__gdsl__bstree.html#gae61c7d19b77e729ef8f79d4709b08aaf">00053</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>gdsl_bstree* <a class="code" href="group__gdsl__bstree.html#gae61c7d19b77e729ef8f79d4709b08aaf" title="GDSL binary search tree type.">gdsl_bstree_t</a>;
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="comment">/******************************************************************************/</span>
<a name="l00056"></a>00056 <span class="comment">/* Management functions of binary search trees                                */</span>
<a name="l00057"></a>00057 <span class="comment">/******************************************************************************/</span>
<a name="l00058"></a>00058 
<a name="l00085"></a>00085 <span class="keyword">extern</span> gdsl_bstree_t
<a name="l00086"></a>00086 <a class="code" href="group__gdsl__bstree.html#ga827933a8d53368e7941811dbcd9d30c6" title="Create a new binary search tree.">gdsl_bstree_alloc</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* NAME,
<a name="l00087"></a>00087            <a class="code" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f" title="GDSL Alloc element function type.">gdsl_alloc_func_t</a> ALLOC_F,
<a name="l00088"></a>00088            <a class="code" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053" title="GDSL Free element function type.">gdsl_free_func_t</a> FREE_F,
<a name="l00089"></a>00089            <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F
<a name="l00090"></a>00090            );
<a name="l00091"></a>00091 
<a name="l00105"></a>00105 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00106"></a>00106 <a class="code" href="group__gdsl__bstree.html#ga29491f517ecf29a732849b3b204d100d" title="Destroy a binary search tree.">gdsl_bstree_free</a> (gdsl_bstree_t T
<a name="l00107"></a>00107           );
<a name="l00108"></a>00108 
<a name="l00123"></a>00123 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00124"></a>00124 <a class="code" href="group__gdsl__bstree.html#ga3d10b0fa5f53b74c1cdfaad12ba2bb34" title="Flush a binary search tree.">gdsl_bstree_flush</a> (gdsl_bstree_t T
<a name="l00125"></a>00125            );
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 <span class="comment">/******************************************************************************/</span>
<a name="l00128"></a>00128 <span class="comment">/* Consultation functions of binary search trees                              */</span>
<a name="l00129"></a>00129 <span class="comment">/******************************************************************************/</span>
<a name="l00130"></a>00130 
<a name="l00140"></a>00140 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
<a name="l00141"></a>00141 <a class="code" href="group__gdsl__bstree.html#gaa8de37ef22df3fcf158d817cd2b71989" title="Get the name of a binary search tree.">gdsl_bstree_get_name</a> (<span class="keyword">const</span> gdsl_bstree_t T
<a name="l00142"></a>00142               );
<a name="l00143"></a>00143 
<a name="l00152"></a>00152 <span class="keyword">extern</span> <span class="keywordtype">bool</span>
<a name="l00153"></a>00153 <a class="code" href="group__gdsl__bstree.html#gafb4ecfc26d1a68fd35abb1335b09d7ef" title="Check if a binary search tree is empty.">gdsl_bstree_is_empty</a> (<span class="keyword">const</span> gdsl_bstree_t T
<a name="l00154"></a>00154               );
<a name="l00155"></a>00155 
<a name="l00163"></a>00163 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00164"></a>00164 <a class="code" href="group__gdsl__bstree.html#ga7caca9a2de6ede707f6323c24182babd" title="Get the root of a binary search tree.">gdsl_bstree_get_root</a> (<span class="keyword">const</span> gdsl_bstree_t T
<a name="l00165"></a>00165               );
<a name="l00166"></a>00166 
<a name="l00175"></a>00175 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00176"></a>00176 <a class="code" href="group__gdsl__bstree.html#ga3637f29c2a2aab7e4395aeb754950b82" title="Get the size of a binary search tree.">gdsl_bstree_get_size</a> (<span class="keyword">const</span> gdsl_bstree_t T
<a name="l00177"></a>00177               );
<a name="l00178"></a>00178 
<a name="l00187"></a>00187 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00188"></a>00188 <a class="code" href="group__gdsl__bstree.html#gad652b5333d00d547c6f9c69486b8f930" title="Get the height of a binary search tree.">gdsl_bstree_get_height</a> (<span class="keyword">const</span> gdsl_bstree_t T
<a name="l00189"></a>00189             );
<a name="l00190"></a>00190 
<a name="l00191"></a>00191 <span class="comment">/******************************************************************************/</span>
<a name="l00192"></a>00192 <span class="comment">/* Modification functions of binary search trees                              */</span>
<a name="l00193"></a>00193 <span class="comment">/******************************************************************************/</span>
<a name="l00194"></a>00194 
<a name="l00208"></a>00208 <span class="keyword">extern</span> gdsl_bstree_t
<a name="l00209"></a>00209 <a class="code" href="group__gdsl__bstree.html#ga1cdbd5dafd1736a28eaaa9984f1c7130" title="Set the name of a binary search tree.">gdsl_bstree_set_name</a> (gdsl_bstree_t T,
<a name="l00210"></a>00210               <span class="keyword">const</span> <span class="keywordtype">char</span>* NEW_NAME
<a name="l00211"></a>00211               );
<a name="l00212"></a>00212 
<a name="l00235"></a>00235 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00236"></a>00236 <a class="code" href="group__gdsl__bstree.html#gaafeefcedb22ace91320aca9d765f1ed5" title="Insert an element into a binary search tree if it&#39;s not found or return it.">gdsl_bstree_insert</a> (gdsl_bstree_t T,
<a name="l00237"></a>00237             <span class="keywordtype">void</span>* VALUE,
<a name="l00238"></a>00238             <span class="keywordtype">int</span>* RESULT
<a name="l00239"></a>00239             );
<a name="l00240"></a>00240 
<a name="l00259"></a>00259 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00260"></a>00260 <a class="code" href="group__gdsl__bstree.html#ga65cd9f86967ce6bab2c84f3624d27b9b" title="Remove an element from a binary search tree.">gdsl_bstree_remove</a> (gdsl_bstree_t T,
<a name="l00261"></a>00261             <span class="keywordtype">void</span>* VALUE
<a name="l00262"></a>00262             );
<a name="l00263"></a>00263 
<a name="l00283"></a>00283 <span class="keyword">extern</span> gdsl_bstree_t
<a name="l00284"></a>00284 <a class="code" href="group__gdsl__bstree.html#ga222155ce5b98ac50724ea0c3dad779f1" title="Delete an element from a binary search tree.">gdsl_bstree_delete</a> (gdsl_bstree_t T,
<a name="l00285"></a>00285             <span class="keywordtype">void</span>* VALUE
<a name="l00286"></a>00286             );
<a name="l00287"></a>00287   
<a name="l00288"></a>00288 <span class="comment">/******************************************************************************/</span>
<a name="l00289"></a>00289 <span class="comment">/* Search functions of binary search trees                                    */</span>
<a name="l00290"></a>00290 <span class="comment">/******************************************************************************/</span>
<a name="l00291"></a>00291 
<a name="l00311"></a>00311 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00312"></a>00312 <a class="code" href="group__gdsl__bstree.html#gaed9a60ec2f4b0e3aa92217b7ede2d78e" title="Search for a particular element into a binary search tree.">gdsl_bstree_search</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00313"></a>00313             <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F,
<a name="l00314"></a>00314             <span class="keywordtype">void</span>* VALUE
<a name="l00315"></a>00315             );
<a name="l00316"></a>00316 
<a name="l00317"></a>00317 <span class="comment">/******************************************************************************/</span>
<a name="l00318"></a>00318 <span class="comment">/* Parse functions of binary search trees                                     */</span>
<a name="l00319"></a>00319 <span class="comment">/******************************************************************************/</span>
<a name="l00320"></a>00320 
<a name="l00339"></a>00339 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00340"></a>00340 <a class="code" href="group__gdsl__bstree.html#ga435d291d54bee68d6a60b27d985a419c" title="Parse a binary search tree in prefixed order.">gdsl_bstree_map_prefix</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00341"></a>00341             <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00342"></a>00342             <span class="keywordtype">void</span>* USER_DATA
<a name="l00343"></a>00343             );
<a name="l00344"></a>00344 
<a name="l00363"></a>00363 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00364"></a>00364 <a class="code" href="group__gdsl__bstree.html#ga3e670ad1b829d0a130955f23fc02d181" title="Parse a binary search tree in infixed order.">gdsl_bstree_map_infix</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00365"></a>00365                <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00366"></a>00366                <span class="keywordtype">void</span>* USER_DATA
<a name="l00367"></a>00367                );
<a name="l00368"></a>00368 
<a name="l00387"></a>00387 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00388"></a>00388 <a class="code" href="group__gdsl__bstree.html#ga27d351ef715f630339e43a89dcb7451b" title="Parse a binary search tree in postfixed order.">gdsl_bstree_map_postfix</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00389"></a>00389              <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00390"></a>00390              <span class="keywordtype">void</span>* USER_DATA
<a name="l00391"></a>00391              );
<a name="l00392"></a>00392 
<a name="l00393"></a>00393 <span class="comment">/******************************************************************************/</span>
<a name="l00394"></a>00394 <span class="comment">/* Input/output functions of binary search trees                              */</span>
<a name="l00395"></a>00395 <span class="comment">/******************************************************************************/</span>
<a name="l00396"></a>00396 
<a name="l00413"></a>00413 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00414"></a>00414 <a class="code" href="group__gdsl__bstree.html#gaa80cab0737a5c0b05806a6842b750153" title="Write the element of each node of a binary search tree to a file.">gdsl_bstree_write</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00415"></a>00415            <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00416"></a>00416            FILE* OUTPUT_FILE,
<a name="l00417"></a>00417            <span class="keywordtype">void</span>* USER_DATA
<a name="l00418"></a>00418            );
<a name="l00419"></a>00419 
<a name="l00438"></a>00438 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00439"></a>00439 <a class="code" href="group__gdsl__bstree.html#ga5793f90350fe13ccf07401302598a150" title="Write the content of a binary search tree to a file into XML.">gdsl_bstree_write_xml</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00440"></a>00440                <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00441"></a>00441                FILE* OUTPUT_FILE,
<a name="l00442"></a>00442                <span class="keywordtype">void</span>* USER_DATA
<a name="l00443"></a>00443                );
<a name="l00444"></a>00444 
<a name="l00462"></a>00462 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00463"></a>00463 <a class="code" href="group__gdsl__bstree.html#ga247de535753525e033f563d68699b630" title="Dump the internal structure of a binary search tree to a file.">gdsl_bstree_dump</a> (<span class="keyword">const</span> gdsl_bstree_t T,
<a name="l00464"></a>00464           <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00465"></a>00465           FILE* OUTPUT_FILE,
<a name="l00466"></a>00466           <span class="keywordtype">void</span>* USER_DATA
<a name="l00467"></a>00467           );
<a name="l00468"></a>00468 
<a name="l00469"></a>00469 <span class="comment">/*</span>
<a name="l00470"></a>00470 <span class="comment"> * @}</span>
<a name="l00471"></a>00471 <span class="comment"> */</span>
<a name="l00472"></a>00472 
<a name="l00473"></a>00473 
<a name="l00474"></a>00474 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00475"></a>00475 <span class="preprocessor"></span>}
<a name="l00476"></a>00476 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00477"></a>00477 
<a name="l00478"></a>00478 
<a name="l00479"></a>00479 <span class="preprocessor">#endif </span><span class="comment">/* _GDSL_BSTREE_H_ */</span>
<a name="l00480"></a>00480 
<a name="l00481"></a>00481 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="gdsl__bstree_8h.html">gdsl_bstree.h</a>      </li>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
